package com.cyq.day17.Demo5;

public class Test {
    public static void main(String[] args) {
        Fruit[] f=new Fruit[4];
        f[0]=new Apple();
        f[1]=new Orange();
        f[2]=new Apple();
        f[3]=new Orange();
        for (int i = 0; i <f.length ; i++) {
           f[i].eat();
        }
    }
}
